package cn.edu.zut.service;

import cn.edu.zut.dao.UserDao;
import cn.edu.zut.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 袁飞
 * @date 2019/6/19/01915:16
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserDao userDao;
    public void insertUser(User user) {
        userDao.insertUser(user);
    }

    public User selectOneUserById(int id) {
        return userDao.selectOneUserById(id);
    }

    public List<User> selectAllUser() {
        return userDao.selectAllUser();
    }

    public void updateUserById(User user) {
        userDao.updateUserById(user);
    }

    public void deleteUserById(int id) {
        userDao.deleteUserById(id);
    }

    public void deleteUserByName(String name) {
        userDao.deleteUserByName(name);
    }

    public void updateUserByName(User user){
        userDao.updateUserByName(user);
    }
    public User selectOneUserByName(String name){
        return userDao.selectOneUserByName(name);
    }
}
